﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TPOJ.Model.Account>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Account -- <%= Html.Encode(Model.Name) %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2><%= Html.Encode(Model.Name) %></h2>

    <table>
        <tr>
            <th>Rank</th>
            <td><%= (int)ViewData["Rank"] %></td>
        </tr>
        <tr>
            <th>Solved</th>
            <td><%= Html.Encode(Model.Solved) %></td>
        </tr>
        <tr>
        <th>Submits</th>
        <td><%= Html.Encode(Model.Submits) %></td>
        </tr>
        <tr>
            <th>School</th>
            <td><%= Html.Encode(Model.School) %></td>
        </tr>
        <tr>   
        <th>Email</th>
        <td><%= Html.Encode(Model.Email) %></td>
        </tr>
    </table>
    <br />
    <table>
        <tr>
            <th>Solved Problems List</th>
        </tr>
        <% foreach (var item in (IList<int>)ViewData["SolvedProblems"]) { %>
        <tr>
            <td><%= Html.ActionLink(item.ToString(), "Details", "Problem", new { id = item }, new { target = "_blank" })%></td>
        </tr>
        <% } %>
    </table>
    <br />
    <h2>Neighbours</h2>
    <table>
        <tr>
            <th>Rank</th>
            <th>User</th>
            <th>Solved</th>
            <th>Submissions</th>
        </tr>
        <% foreach (var item in (IList<Tuple<int,TPOJ.Model.Account>>)ViewData["Neighbours"])  { %>
        <tr>
            <td><%=Html.Encode(item.Item1) %></td>
            <td><%=Html.Encode(item.Item2.Name) %></td>
            <td><%=Html.Encode(item.Item2.Solved) %></td>
            <td><%=Html.Encode(item.Item2.Submits) %></td>
        </tr>
        <%  } %>
    </table>
</asp:Content>

